package com.furongji.education.domain.po;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import com.furongji.common.enums.ArticleStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 社区文章表
 * </p>
 *
 * @author furongji
 * @since 2025-06-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("article")
@Schema(description = "社区文章表")
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "文章ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "发布文章的用户ID")
    private String userId;

    @Schema(description = "发布文章的用户名称")
    private String userName;

    @Schema(description = "发布文章的用户头像")
    private String userAvatar;

    @Schema(description = "文章标题")
    private String title;

    @Schema(description = "文章正文（支持富文本）")
    private String content;

    @Schema(description = "文章封面")
    private String cover;

    @Schema(description = "文章状态 Draft草稿箱  Normal已发布")
    private ArticleStatusEnum status;

    @Schema(description = "浏览量")
    private Integer viewCount;

    @Schema(description = "点赞数")
    private Integer likeCount;

    @Schema(description = "乐观锁")
    @Version
    private Long version;

    @Schema(description = "0 未删除,1 已删除")
    @TableLogic
    private Boolean isDeleted;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;


}
